package com.future;

import java.util.HashSet;
import java.util.Set;

/**
 * Description: 575. 分糖果
 *
 * @author weiruibai.vendor
 * Date: 2023/3/22 14:55
 */
public class Solution_575 {

    public int distributeCandies(int[] candyType) {
        int N = candyType.length;
        Set<Integer> set = new HashSet<>();
        for (int i = 0; i < N; i++) {
            set.add(candyType[i]);
        }
        return Math.min(set.size(), N / 2);
    }
}
